//
//  NSObject+LogObj.m
//  XiaoOuiKankan
//
//  Created by shaowei on 11/7/13.
//  Copyright (c) 2013 Liu Stuart. All rights reserved.
//

#import "NSObject+LogObj.h"
#import <objc/runtime.h>

#ifdef DEBUG
void logProperty(id model){
    NSLog(@"\n\n********** Class name: %@ ---start **********",NSStringFromClass([model class]));
    unsigned int outCount;
    objc_property_t *properties = class_copyPropertyList([model class], &outCount);
    
    for (int i = 0; i < outCount; i++) {
        objc_property_t property = properties[i];
        NSString *propertyName=[NSString stringWithUTF8String:property_getName(property)];
        NSLog(@"SW -Property %@:%@",propertyName,[model valueForKey:propertyName]);
        
    }
    free(properties);
    NSLog(@"\n********** Class name: %@ ---end **********\n\n",NSStringFromClass([model class]));
}

#endif